package com.itheima.practice;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class SimpleDateFormat01 {
    public static void main(String[] args) throws ParseException {
        Date date =new Date();
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        System.out.println(sdf.format(date));

        String s = "2020-09-02 09:37:03";
        Date parse = sdf.parse(s);
        System.out.println(parse);

    }
}
